package org.paul.library.base;

import android.app.Application;

import java.util.ArrayList;
import java.util.List;

public class App extends Application {

    private final List<BaseAct> baseActList = new ArrayList<>();
    private static App instance;

    @Override
    public void onCreate() {
        super.onCreate();
        instance=this;
    }
    public static App getInstance(){
        return instance;
    }

    public boolean addAct(BaseAct baseAct) {
        if (!baseActList.contains(baseAct)) {
            return baseActList.add(baseAct);
        }
        return false;
    }

    public boolean removeAct(BaseAct baseAct) {
        if (baseActList.contains(baseAct)) {
            return baseActList.remove(baseAct);
        }
        return false;
    }

}
